<?php
namespace app\home\controller;

use \think\Controller;
use \think\Request as Request;
use \think\Session;
class Home extends Controller{
    protected $req = '';
    public function _initialize(){
        parent::_initialize();
        $this->req = Request::instance();
        if(Session::has("stu")){
            $this->assign('stu',Session('stu'));
            
        }
    }
    protected function right($data=[]){
        if(!isset($data['state'])){
            $data['state'] = 1;
        }
        return json_encode($data);
    }
    protected function wrong($data=[]){
        if(!isset($data['state'])){
            $data['state'] = 0;
        }
        return json_encode($data);
    }
}
